package cn.itsnkkka;
import java.util.Scanner;


public class Work_08 {
    public static void main(String[] args) {
        //通过键盘输入书名、作者和价格
        Scanner scanner = new Scanner(System.in);
        String title = scanner.next();
        String author = scanner.next();
        double price = scanner.nextDouble();

        Book book=new Book(title,author,price);
        System.out.println("title: "+book.getTitle());
        System.out.println("author: "+book.getAuthor());
        System.out.println("price: "+book.getPrice());
    }
}
class Book {
//编写类Book，在该类中定义了3个成员变量，即title表示书名、author表示作者、price表示价格。此外，还有3个get方法分别用来获取书名、作者和价格。
    private String title;
    private String author;
    private double price;

    public Book(String title, String author, double price) {
        this.title = title;
        this.author = author;
        this.price = price;
    }

    public String getTitle() {
        return title;
    }

    public String getAuthor() {
        return author;
    }

    public double getPrice() {
        return price;
    }
}
